<?php

/**
 * uniBoard System Initialisation file
 *
 * Light and fast forum solution for web 2.0-like communities.
 *
 * @package		uniBoard
 * @author		Rafał Pitoń
 * @license		http://www.gnu.org/licenses/gpl-3.0.html
 * @since		Version 0.1
 * 
 * ------------------------------------------------------------------------
 * 
 * $Date: 2010-09-06 01:45:14 +0000 (Mon, 06 Sep 2010) $
 * $Revision: 59 $
 * $Author: rafio.xudb@gmail.com $
 */

// ------------------------------------------------------------------------

// Version check
if ( version_compare( '5.1', PHP_VERSION) == 1)
{
	// Kill runtime
	die( 'uniBoard requires PHP version to be at least 5.1 to work correctly. Host PHP version is ' . PHP_VERSION . '.');
}

// ------------------------------------------------------------------------

// Short product name
define( 'PRODUCT_NAME', 'uniBoard');

// Product version id (used by update script)
define( 'PRODUCT_VERSION_ID', '0');

// Product human-understandable version
define( 'PRODUCT_VERSION_LABEL', '0.1 DEV');

// Product is stable? (makes varning show up in ACP)
define( 'PRODUCT_VERSION_STABLE', false);

// ------------------------------------------------------------------------

// Set error reporting level to E_ALL
error_reporting( E_ALL);

// Set timeout to 0 seconds
set_time_limit( 0);

// ------------------------------------------------------------------------

// DETECT LIBLARIES AVAIABILITY

// Detect MultiByte string functions avaiability
define( 'USE_MB_STRING', extension_loaded( 'mbstring'));

// Detect GD2 avaiability
define( 'USE_GD_EXT', extension_loaded( 'gd') || extension_loaded( 'gd2'));

// Detect glob() avaiability
define( 'USE_GLOB', function_exists( 'glob'));

// Escape Magic Quotes
define( 'ESCAPE_MAGIC_QUOTES', get_magic_quotes_gpc() == 1);

// ------------------------------------------------------------------------

// BEGIN INCLUDING ADDITIONAL FILES

// Include constants
require_once( ROOT_PATH.'constants' . PHP_EXT);

// Include critical type exception
require_once( EXCEPTIONS_PATH . 'exc_critical' . PHP_EXT);

// Include main class
require_once( SYSTEM_PATH . 'core' . PHP_EXT);

// Include autoloader
require_once( SYSTEM_PATH . 'autoloader' . PHP_EXT);